#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>
void* my_memmove(void* arr, void* arr2, size_t sz)
{
    void* tmp = arr;
    if (arr < arr2)
    {
        while (sz--)
        {
            *(char*)arr = *(char*)arr2;
            arr = (char*)arr + 1;
            arr2 = (char*)arr2 + 1;
        }
    }
    else
    {
        arr = (char*)arr + sz - 1;
        arr2 = (char*)arr2 + sz - 1;
        while (sz--)
        {
            *(char*)arr = *(char*)arr2;
            arr = (char*)arr - 1;
            arr2 = (char*)arr2 - 1;
        }
    }
    return tmp;
}
int main()
{
    int a[] = { 1,2,3,4,5,6,7,8,9,10 };
    int b = sizeof(a) / sizeof(a[0]);
    my_memmove(a + 3, a + 1, 20);
    for (int sz = 0; sz < b; sz++)
        printf("%d ", a[sz]);
}
//int main()
//{
//    int arr[] = { 1,2,3,4,5,6,7,8,9,10 };
//    int arr2[20] = { 0 };
//    memmove(arr2, arr, 40);
//    for (int sz = 0; sz < sizeof(arr2) / sizeof(arr2[0]); sz++)
//        printf("%d ", arr2[sz]);
//}